﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NetFrame;

namespace LOLServer.Cache.Interface
{
    public interface IAccountCache
    { 
        /// <summary>
        /// 账户是否存在
        /// </summary>
        /// <param name="_account"></param>
        /// <returns></returns>
        bool HasAccount(int _accountId);
        /// <summary>
        /// 验证码是否正确
        /// </summary>
        /// <param name="_passToken"></param>
        /// <returns></returns>
        bool YesPassToken(UserToken token,string _passToken);
        /// <summary>
        /// 存储验证码
        /// </summary>
        /// <param name="token"></param>
        /// <param name="_passToken"></param>
        /// <returns></returns>
        void AddPassToken(UserToken token,string _passToken); 
        /// <summary>
        /// 是否在线
        /// </summary>
        /// <param name="_accountId"></param>
        /// <returns></returns>
        bool isOnLine(int _accountId);
        /// <summary>
        /// 获取当前连接对象的ID
        /// </summary>
        /// <param name="token"></param>
        /// <returns></returns>
        int GetAccountId(UserToken token);
        /// <summary>
        /// 上线
        /// </summary>
        /// <param name="token"></param>
        void OnLine(UserToken token,int _accountId);
        /// <summary>
        /// 下线
        /// </summary>
        /// <param name="token"></param>
        void OffLine(UserToken token);
        /// <summary>
        /// 添加账号
        /// </summary>
        void AddAccount(int _accountId,string _passToken);  
    }
}
